<!--%import("filter/delete_checked_notice.xml")-->
<!--%import("css/pagination.css")-->
<h3 class="icoNotice">{$dashboard_menus['ManageNotice']['title']}</h3>

{@ $oModuleModel = &getModel('module')}

<!-- 정보 -->
<div class="summary">
    <strong>Total</strong> <em>{number_format($total_count)}</em>, Page <strong>{number_format($page)}</strong>/{number_format($total_page)}
</div>

<div class="fl">
    <form action="./" method="get" class="adminSearch">
    <input type="hidden" name="module" value="ad" />
    <input type="hidden" name="act" value="dispAdAdminNoticeList" />
        <fieldset>
            <select name="search_target">
                <option value="">{$lang->search_target}</option>
                <!--@foreach($lang->_search_target_list as $key => $val)-->
                <option value="{$key}"<!--@if($search_target == $key)--> selected="selected"<!--@end-->>{$val}</option>
                <!--@end-->
            </select>
            <input type="text" name="search_keyword" value="" class="inputTypeText" />
            <span class="buttonAction actionBlue"><input type="submit" value="{$lang->cmd_search}" /></span>
            <span class="buttonAction actionWhite normal"><a href="{getUrl('module','admin','dispAdAdminTotalList')}"><span>{$lang->cmd_cancel}</span></a></span>
        </fieldset>
    </form>
</div>

<form id="fo_list" action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
<table cellspacing="0" class="listTable clear tCenter">
    <tr>
        <th scope="row"><input type="checkbox" onclick="XE.checkboxToggleAll(); return false;" /></th>
        <th scope="row">{$lang->status}</th>
        <th scope="row">{$lang->module}</th>
        <th scope="row">{$lang->ad_content}</th>
        <th scope="row">{$lang->ads->author}</th>
        <th scope="row">{$lang->ads->regdate}</th>
    </tr>
    {@ $ModuleInfo = array()}
    <!--@if(count($notice_list)) -->
    <!--@foreach($notice_list as $no => $ad)-->
    <!--@if($ModuleInfo[$ad->get('module_srl')])-->
    {@ $curModuleInfo = $ModuleInfo[$ad->get('module_srl')]}
    <!--@else-->
    {@
        $curModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($ad->get('module_srl'));
        $ModuleInfo[$ad->get('module_srl')] = $curModuleInfo;
    }
    <!--@end-->
    {@ $remainingTime = $ad->getRemainingTime()}
    <!--@if($remainingTime)-->
        {@ $publishedStatus = 1}
    <!--@else-->
        <!--@if($ad->get('end_date') == -1)-->
            {@ $publishedStatus = 2}
        <!--@end-->
    <!--@end-->
    <tr>
        <td><input type="checkbox" name="cart" value="{$ad->document_srl}" /></td>
        <td><!--@if($publishedStatus)--><strong class="publishState out"><span>{$lang->ads->status->published}</span></strong><!--@elseif(!$publishedStatus)--><strong class="publishState"><span>{$lang->ads->status->wait}</span></strong><!--@else--><strong class="publishState draft"><span>{$lang->ads->status->end}</span></strong><!--@end--></td>
        <td>{$curModuleInfo->mid} ({$curModuleInfo->browser_title})</td>
        <td>{cut_str($ad->getTitleText(),100)}</td>
        <td>{$ad->get('nick_name')}</td>
        <td>{zdate($ad->get('regdate'))}</td>
    </tr>
    <!--@if(($ad->get('ad_time') % 10000) === 0)-->
    {@
        $AdTime = $ad->get('ad_time') / 10000;
        $AdTimeUnit = $lang->ads->unit_time->hour;
    }
    <!--@end-->
    {@ $AdType = $ad->get('ad_type')}
    <tr>
        <td class="tLeft itemsRow" colspan="6">
            <ul class="items">
                <!--@if($AdType)--><li>{$lang->ad_type} : <!--@if($AdType == 'linead')-->{$lang->linead}<!--@elseif($AdType == 'banner')-->{$lang->banner}<!--@end--></li><!--@end-->
                <!--@if($AdTime)--><li>{$lang->ad_time} : {$AdTime}{$AdTimeUnit}</li><!--@end-->
                <!--@if($ad->getUrl())--><li>URL : {$ad->getUrl()}</li><!--@end-->
                <!--@if($remainingTime)--><li>{$lang->remaining_time} : {$remainingTime}</li><!--@end-->
            </ul>
        </td>
    </tr>
    <!--@end-->
	<!--@else-->
	<tr>
		<td class="tCenter" colspan="7">{$lang->ads->msg->not_exists_notice}</td>
	</tr>
	<!--@end-->
</table>

<!-- 페이지 네비게이션 -->
<div class="pagination">
    <a href="{getUrl('page','','module_srl',$module_srl)}" class="prev"><span>{$lang->first_page}</span></a> 
    <!--@while($page_no = $page_navigation->getNextPage())-->
        <!--@if($page == $page_no)-->
            <strong>{$page_no}</strong> 
        <!--@else-->
            <a href="{getUrl('page',$page_no,'module_srl',$module_srl)}">{$page_no}</a> 
        <!--@end-->
    <!--@end-->
    <a href="{getUrl('page',$page_navigation->last_page,'module_srl',$module_srl)}" class="next"><span>{$lang->last_page}</span></a>
</div>

<div class="fr">
	<span class="buttonAction actionBlue"><a href="{getUrl('act','dispAdAdminNoticeWrite')}"><span>{$lang->cmd_submit}</span></a></span>
	<span class="buttonGray large"><input type="submit" value="{$lang->cmd_delete}" /></span>
</div>